﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 

namespace Fdays.WebApp.Module
{
    public class TimeHelper
    {
        public delegate void Body();

        public static string CountTime(string msg, Body action)
        {
            DateTime begin, end;
            begin = DateTime.Now;
            action();
            end = DateTime.Now;
            
            string msgShow = (string.Format("{0}:执行所花时间 {1} ms", msg, end.Subtract(begin).TotalMilliseconds));
            return msgShow;
        }
    }
}
